package com.myw.mail.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.myw.mail.mapper.EncryptConfigMapper;
import com.myw.mail.domain.EncryptConfig;
import com.myw.mail.service.IEncryptConfigService;

/**
 * 加密配置Service业务层处理
 * 
 * @author myw
 * @date 2025-07-10
 */
@Service
@Slf4j
public class EncryptConfigServiceImpl extends ServiceImpl<EncryptConfigMapper, EncryptConfig> implements IEncryptConfigService
{
    @Autowired
    private EncryptConfigMapper encryptConfigMapper;

    /**
     * 查询加密配置
     * 
     * @param id 加密配置主键
     * @return 加密配置
     */
    @Override
    public EncryptConfig selectEncryptConfigById(String id)
    {
        return encryptConfigMapper.selectEncryptConfigById(id);
    }

    /**
     * 查询加密配置列表
     * 
     * @param encryptConfig 加密配置
     * @return 加密配置
     */
    @Override
    public List<EncryptConfig> selectEncryptConfigList(EncryptConfig encryptConfig)
    {
        return encryptConfigMapper.selectEncryptConfigList(encryptConfig);
    }

    /**
     * 新增加密配置
     * 
     * @param encryptConfig 加密配置
     * @return 结果
     */
    @Override
    public int insertEncryptConfig(EncryptConfig encryptConfig)
    {
        encryptConfig.setCreateTime(DateUtils.getNowDate());
        return encryptConfigMapper.insertEncryptConfig(encryptConfig);
    }

    /**
     * 修改加密配置
     * 
     * @param encryptConfig 加密配置
     * @return 结果
     */
    @Override
    public int updateEncryptConfig(EncryptConfig encryptConfig)
    {
        encryptConfig.setUpdateTime(DateUtils.getNowDate());
        return encryptConfigMapper.updateEncryptConfig(encryptConfig);
    }

    /**
     * 批量删除加密配置
     * 
     * @param ids 需要删除的加密配置主键
     * @return 结果
     */
    @Override
    public int deleteEncryptConfigByIds(String[] ids)
    {
        return encryptConfigMapper.deleteEncryptConfigByIds(ids);
    }

    /**
     * 删除加密配置信息
     * 
     * @param id 加密配置主键
     * @return 结果
     */
    @Override
    public int deleteEncryptConfigById(String id)
    {
        return encryptConfigMapper.deleteEncryptConfigById(id);
    }
}
